<div id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="columns-right pull-right" style="margin-top:10px;margin-bottom:10px;"></div>
<!--    class="table table-striped table-bordered table-hover table-nowrap"  data-operate-edit="1" data-operate-del="1"-->
    <table id="table" class="table table-striped table-bordered table-hover" width="100%" style="background-color:#EEEEEE ">

<!--    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"  data-operate-edit="1" data-operate-del="1"   width="auto" >-->
        <thead>
            <tr>
                <th style="text-align: center; vertical-align: middle;row-span:3 " data-field="id" rowspan="3" ><div class="th-inner " >Id</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="createtime" rowspan="3"><div class="th-inner ">商品名称</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="number" rowspan="3"><div class="th-inner " >编号</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="number" rowspan="3"><div class="th-inner ">规格</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="status" rowspan="3"><div class="th-inner ">产地</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="supplier_id" rowspan="3"><div class="th-inner ">基本单位</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="company" rowspan="3"><div class="th-inner ">零售价</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" rowspan="3"><div class="th-inner ">最高进价</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="operator"rowspan="3" ><div class="th-inner ">上期数量</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" rowspan="3"><div class="th-inner ">上期金额</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" colspan="2"><div class="th-inner ">本期入库</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" colspan="2"><div class="th-inner ">本期出库</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" rowspan="3"><div class="th-inner ">本期数量</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" rowspan="3"><div class="th-inner ">成本均价</div></th>
                <th style="text-align: center; vertical-align: middle; " data-field="order_goods_total" rowspan="3"><div class="th-inner ">本期金额</div></th>
            </tr>
            <tr>
                <th style="text-align: center; vertical-align: middle; "><div class="th-inner " >数量</div></th>
                <th style="text-align: center; vertical-align: middle; "><div class="th-inner ">金额</div></th>
                <th style="text-align: center; vertical-align: middle; "><div class="th-inner " >数量</div></th>
                <th style="text-align: center; vertical-align: middle; "><div class="th-inner ">金额</div></th>
            </tr>
        </thead>
        <tbody data-listidx="0" class="connnn">
        {volist name="list" id="vo"}
            <tr data-index="0">
                <td style="text-align: center; vertical-align: middle; "><input  value="" style="display: none" >1</td>
                <td style="text-align: center; vertical-align: middle; ">2</td>
                <td style="text-align: center; vertical-align: middle; " >3</td>
                <td style="text-align: center; vertical-align: middle; " class="title">4</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
                <td style="text-align: center; vertical-align: middle; ">5</td>
            </tr>
        {/volist}
        </tbody>
        <tfoot>
        <tr data-index="0">
            <td style="text-align: center; vertical-align: middle; "><input  value="" style="display: none" >合计</td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; "></td>
            <td style="text-align: center; vertical-align: middle; " class="allprice"></td>
        </tr>
        </tfoot>
    </table>
</div>
</div>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<script src="__CDN__/assets/extends/dist/js.js"></script>
<div id="pageParent" class="pageParent">
</div>


<script>
    var page = 0;
    var is_start = 0;
    var pagesize = 20;
    var datas = data;
    function openresults(data){
        data.page = page
        data.pagesize = pagesize
        datas = data;
        console.log(data)
        getall(data)
        var url = Config.this_url+'/coll/summary/results'
        $.post(url,data,function (res) {
            total = res.total
            res = res.data;
            if(res.length >0){
                dmm({
                    cssStyle: 3,
                    container: "pageParent",
                    callback: function (e) {
                        e.index;
                        e.pageSize1;
                        e.countpage = Math.ceil(total / pagesize);
                        e.infocount = total
                        xian(e);
                        runCallback1 = e;
                    }
                });
                // page++;
                is_start = 1;
                str = ''
                for (var i=0;i<res.length;i++ ){
                    str += '<tr data-index="0" data-goodsid="'+res[i]['goods_id']+'">\n' +
                        '       <td style="text-align: center; vertical-align: middle; "><input  value="" style="display: none" >'+res[i]['goods_id']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['title']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['number']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['specs']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['place_origin']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['unit']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+0+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+0+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['after_num']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['after_price']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; background-color: yellow;">'+res[i]['enter_num']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['enter_price']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; background-color: #3fb4f3;">'+res[i]['out_num']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['out_price']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['ben_num']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['final_cost']+'</td>\n' +
                        '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['ben_price']+'</td>\n' +
                        '   </tr>'
                }
                $('.connnn').append(str)
            }
        })
    }
</script>
<script>
    var runCallback1 = null;

    dmm({
        // index: 1,/
        cssStyle: 3,//
        // size: [10, 20, 30],//
        // skip: true,//
        // setSize: true,//
        container: "pageParent",//
        callback: function (e) {
            e.index;//
            e.pageSize1;//

            e.countpage = Math.ceil(0 / e.pageSize1);//
            e.infocount = 0;//
            xian(e);//
            runCallback1 = e;//
        }
    });

    function dian() {
        runCallback1.index = 1;
        hui(runCallback1);
    }

    var arrtext=[];
    var arr1=["first", "up", "next", "last", "jump", "page", "ok", "pageindex: ", "all: "];
    var arr2=["<<", "<", ">", ">>", "~~>", "", "to", "Ò³£º", "×Ü£º"];
    var arr3=["Ê×Ò³", "ÉÏÒ»Ò³", "ÏÂÒ»Ò³", "Î²Ò³", "Ìø×ª","Ò³","È·¶¨","Ò³Êý£º", "×ÜÌõÊý£º"];

    arrtext.push(arr1);
    arrtext.push(arr2);
    arrtext.push(arr3);
    function hui(obj) {
        var options1 = $.extend(Objarr[obj.controlIndex], obj);
        Objarr[obj.controlIndex].huidiao(options1);
        // console.log(obj)
        // console.log(obj['index'])
        if(is_start == 1){
            datas.page = obj['index']-1
            datas.pagesize = pagesize
            var url = Config.this_url+'/coll/summary/results'
            $.post(url,datas,function (res) {
                total = res.total
                res = res.data;
                if(res.length >0){
                    str = ''
                    for (var i=0;i<res.length;i++ ){
                        str += '<tr data-index="0" data-goodsid="'+res[i]['goods_id']+'">\n' +
                            '       <td style="text-align: center; vertical-align: middle; "><input  value="" style="display: none" >'+res[i]['goods_id']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['title']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['number']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['specs']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['place_origin']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['unit']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+0+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+0+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['after_num']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['after_price']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; background-color: yellow;">'+res[i]['enter_num']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['enter_price']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; background-color: #3fb4f3;">'+res[i]['out_num']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['out_price']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['ben_num']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['final_cost']+'</td>\n' +
                            '       <td style="text-align: center; vertical-align: middle; ">'+res[i]['ben_price']+'</td>\n' +
                            '   </tr>'
                            '   </tr>'
                    }
                    $('.connnn').find('tr').remove()
                    $('.connnn').append(str)
                }
            })
        }
    }
    function getall(datas) {
        var url = Config.this_url+'/coll/summary/getall'
        $.post(url,datas,function (res) {
            $('.allprice').html(res)
        })
    }

</script>